<template>

  <nav class="navbar bg-dark navbar navbar-expand-lg bg-body-tertiary" data-bs-theme="dark">
  <div class="container">
    <!-- <a class="navbar-brand" href="/">King of Bots</a> -->
    <router-link class="navbar-brand" :to="{name: 'home'}">King of Bots </router-link>

    <div class="collapse navbar-collapse" id="navbarText">

      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <!-- 根据路径是否高亮某个标签判断需要在类的前面加上一个： 如果是路径执行nav-link active类， 不是执行nav-link类 -->

        <li class="nav-item">
          <router-link :class="route_name == 'pk_index' ? 'nav-link active' : 'nav-link'" :to="{name: 'pk_index'}">对战</router-link>
        </li>
        <li class="nav-item">
          <router-link :class="route_name == 'record_index' ? 'nav-link active' : 'nav-link'" :to="{name: 'record_index'}">对局列表</router-link>
        </li>
        <li class="nav-item">
          <router-link :class="route_name == 'ranklist_index' ? 'nav-link active' : 'nav-link'" :to="{name: 'ranklist_index'}">排行榜</router-link>
        </li>
      </ul>

      <ul class="navbar-nav ">
    
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            tianzhenjie
          </a>
          <ul class="dropdown-menu">
            <li>
              <!-- <a class="dropdown-item" href="/user/bot/">我的机器人</a> -->
              <router-link class="dropdown-item"  :to="{name: 'user_bot_index'}">我的机器人</router-link>
            </li>
              
            <li>
              <a class="dropdown-item" href="#">退出</a></li>
            <li>
              <hr class="dropdown-divider"></li>

          </ul>
        </li>

      </ul>
    </div>
  </div>
  </nav>

</template>

<script>
// 引用路径
import { useRoute } from 'vue-router'
//实时计算
import { computed } from 'vue'



export default {
    setup() {
        const route = useRoute();
        let route_name = computed(() => route.name)

   
        return {
            route_name
        }
    }
}




</script>

<style scoped>

</style>